const {ccclass, property} = cc._decorator;

@ccclass
export default class OnBack extends cc.Component{

    onLoad(){
        const btn = this.node.getChildByName('btn_back');
        cc.vv.utils.addClickEvent(btn, this.node, 'OnBack', 'onBtnClicked');
    }
    
    /**
     * 
     * @param event 
     */
    onBtnClicked(event: cc.Event){
        if(event.target.name == 'btn_back'){
            this.node.active = false; 
        }
    }
}